package com.itheima.demo02;

//可变参数：修饰符 返回值类型 方法名(数据类型… 变量名) {  }
public class StreamClass01 {
    public static void main(String[] args) {
        int result = sum(1, 2, 3, 4, 5, 6, 7, 8, 9);
        System.out.println(result);
    }

    public static int sum(int... a) {
        int sum = 0;
        for (int i : a) {
            sum += i;
        }
        return sum;
    }
}
